<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page isELIgnored="false" %>
<!doctype html>
<html lang="en">
<head>
    <title>Home</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-cache">
    <meta http-equiv="Expires" content="0">
    <link href="/layui/css/layui.css" rel="stylesheet" type="text/css"/>

</head>
<style>
    .big {
        height: 200px;
        width: 200px;
        position: absolute;
        left: 133px;
    }

    .small {
        height: 100px;
        width: 100px;
        position: relative;
        left: 100px;
        top: 100px;
        margin-top: -50px;
        margin-left: 1px;
    }
</style>

<body>
</body>
<div id="pic" class="">

    <div class="layui-upload-drag small " id="test10" style="float: left">
        <i class="layui-icon"></i>
        <p>点击上传，或将文件拖拽到此处(请上传一寸照)有图片将覆盖</p>
        <div class="layui-hide" id="uploadDemoView">
            <img src="" alt="上传成功后渲染" style="max-width: 200px;margin-left: -47px;margin-top: 10px">
        </div>

    </div>
    <div class="anniu" style="float: left;margin-left: -17px;margin-top: 15px">
        <button class="layui-btn layui-btn-sm layui-btn-danger" id="del"
                style="margin-left: 16px;float: left">删除图片
        </button>
    </div>
</div>

<script src="/js/jQuery-2.1.4.min.js"></script>
<script src="/layui/layui.all.js"></script>
<script src="/js/getParam.js"></script>
<script src="/js/up.js"></script>

<script>
    layui.use('upload', function () {
        var $ = layui.jquery
            , upload = layui.upload;


        upload.render({
            elem: '#test10'
            , url: '/upload?studentId=' + getUrlParam("studentId") //改成您自己的上传接口
            , done: function (res) {
                layer.msg('上传成功');
                layui.$('#uploadDemoView').removeClass('layui-hide').find('img').attr('src', res.msg);
                console.log(res);


            }
            , exts: "jpg|png|gif|bmp|jpeg"
            , size: 800
        });

    });
</script>


</html>